<h1>Listing memberships</h1>

<p>
  <%= link_to 'Group', group_path(@group) %> |
  <%= link_to 'Memberships', group_memberships_path(@group) %> | 
  <%= link_to 'Invitations', group_invitations_path(@group) %>
</p>

<table>
  <tr>
    <th>Group</th>
    <th>User</th>
    <th>Role</th>
  </tr>

<% for membership in @memberships %>
  <tr>
    <td><%=h @group.name %></td>
    <td><%=h membership.user.name %></td>
    <td><%=h membership.role.rolename %></td>
    <td><%= link_to 'Show', group_membership_path(@group, membership) %></td>
    <td><%= link_to 'Edit', edit_group_membership_path(@group, membership) %></td>
    <td><%= link_to 'Destroy', group_membership_path(@group, membership), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>